
const $ = require('../../utils/utils.js')
const config = require('../../config')
const hostUrl = require('../../config').hostUrl
Page({

  /**
   * 页面的初始数据
   */
  data: {
      vip_type:'',
      vip_content:'',
      pay_amount:'',
      extra_amount:'',//微信支付
      cash_amount:''  
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
      this.queryPayStatus()
  },

  queryPayStatus:function(){
      let data = {
          userid: wx.getStorageSync('userid'),
          usertoken: wx.getStorageSync('usertoken')
      }
      $.post(config.queryPayStatus,data).then(data=>{
          console.log('#getVip_succss__queryPayStatus__data',data)
          this.setData({
              vip_type: data.detail.vip_type,
              vip_content: data.detail.vip_content,
              pay_amount: parseFloat(data.detail.pay_amount),
              extra_amount: parseFloat(data.detail.extra_amount),
              cash_amount: parseFloat(data.detail.cash_amount)
          })
      })

  },

  gotoIndex:function(){
    //   $.goto(config.page.index,true)
      wx.navigateBack({
          delta: 2
      })
  }
})